package com.cxkj.shop.proc.order;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.session.SqlSessionFactory;

import net.wangds.common.processor.AbstractInputOutputProcessor;

import com.cxkj.shop.model.order.Order;
import com.cxkj.shop.proc.DefaultSelectListMybatisProc;
import com.cxkj.shop.utils.OrderUtils;

/**
 * @author zhao_f
 *
 */
public class SelOrderListByTimerTypeProc extends AbstractInputOutputProcessor<String,Collection<Order>>{
	
	
	private DefaultSelectListMybatisProc<Map<String, Object>, ?> proc=new DefaultSelectListMybatisProc<>();
	
	private String timertype=null;
		
		public String getTimertype() {
		return timertype;
	}
	
	public void setTimertype(String timertype) {
		this.timertype = timertype;
	}
	private Map<String,Object> thisparam=null;
	
	public Map<String, Object> getThisparam() {
		return thisparam;
	}

	public void setThisparam(Map<String, Object> thisparam) {
		this.thisparam = thisparam;
	}

	public String getSqlId() {
		return proc.getSqlId();
	}

	public void setSqlId(String sqlId) {
		proc.setSqlId(sqlId);
	}

	public SqlSessionFactory getSessionFac() {
		return proc.getSessionFac();
	}

	public void setSessionFac(SqlSessionFactory sessionFac) {
		proc.setSessionFac(sessionFac);
	}
	@SuppressWarnings("unchecked")
	@Override
	protected Collection<Order> process(String arg0) throws Exception {
		// TODO Auto-generated method stub
		Collection<Order> res = null;
		Map<String,Object> param=new HashMap<String,Object>();
		param.put("timertype", this.getTimertype());
	    this.proc.setParameter(param);
	    this.proc.process();
	    Collection<Map<String,Object>> rcds = (Collection<Map<String, Object>>) this.proc.getResult();
	    res=OrderUtils.transRecordMaps2OrderByTimerType(rcds);
		return res;
	}

}
